package com.woniu.outlet.dao;

import com.woniu.outlet.po.PurchasePo;
import com.woniu.outlet.po.PurchasePoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface PurchasePoMapper {
    long countByExample(PurchasePoExample example);

    int deleteByExample(PurchasePoExample example);

    int deleteByPrimaryKey(Long id);

    int insert(PurchasePo record);

    int insertSelective(PurchasePo record);

    List<PurchasePo> selectByExample(PurchasePoExample example);

    PurchasePo selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") PurchasePo record, @Param("example") PurchasePoExample example);

    int updateByExample(@Param("record") PurchasePo record, @Param("example") PurchasePoExample example);

    int updateByPrimaryKeySelective(PurchasePo record);

    int updateByPrimaryKey(PurchasePo record);

    @Update("update erp_pro_plan.ERP_purchase set status=#{status} where id=#{id}")
    void updatePurchaseStatus(PurchasePo purchasePo);

    @Select("select id from erp_pro_plan.ERP_purchase where purchase_no=#{code}")
    Long getPurchaseIdByCode(Long code);
}